package com.example.lycdays;

import android.app.Application;
import android.content.Context;

import com.example.lycdays.data.bean.User;

import org.litepal.LitePal;

public class BaseApplication extends Application {
    private static Context context;

    //默认没有注册
    private static boolean isRegister = false;
    private User user = null;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        LitePal.initialize(context);

        // 判断用户是否注册
        user = LitePal.findFirst(User.class);
        if (user != null) {
            isRegister = true;
        }

    }

    public static boolean isIsRegister() {
        return isRegister;
    }

    public static Context getContext() {
        return context;
    }

    public static void setIsRegister(boolean isRegister) {
        BaseApplication.isRegister = isRegister;
    }
}
